﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JTicket.UI
{
    public partial class S_Request : System.Web.UI.Page
    {
        private readonly BLL.D_OperInfo bllOper = new BLL.D_OperInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                Bind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {  Model.D_OperInfo oper = bllOper.Oper();
            Model.I_Requirement req = new Model.I_Requirement();
            req.HandleContent = "";
            req.OperCode = oper.OperCode;
            req.RequirementContent = this.lbremake.Text;
            req.RequirementDate = DateTime.Now;
            req.ThCode = oper.ThCode;
            req.UserName = oper.OperName;
            DAL.I_Requirement.Add(req);
            Bind();
            this.lbremake.Text = "";
        } 
        void Bind()
        {
            Model.D_OperInfo oper = bllOper.Oper();
            this.dg1.DataSource = DAL.I_Requirement.GetList(oper.OperCode);
            this.dg1.DataBind();

        }

        protected void dg1_ItemDataBound(object sender, DataGridItemEventArgs e)
        {

        }
    }
}